compose: Generate endian-dependent compact Compose data
authorSimon McVittie <smcv@debian.org>
Mon, 30 Aug 2021 09:13:33 +0000 (10:13 +0100)
committerSimon McVittie <smcv@debian.org>
Fri, 3 Sep 2021 14:08:47 +0000 (15:08 +0100)
commitc26b3d8da6f0ae0abc6d2dcf25f15967efc80959
tree0e746d1b45b5477069f9b6056d5d33e3e494f67d
parenta7dc4faa9575f2aed3c5bda7b0a946e92edd6c15
compose: Generate endian-dependent compact Compose data

The GtkComposeTable cache is always in big-endian format and is
byteswapped on load for the more common little-endian CPUs, but
init_builtin_table() in GtkIMContextSimple can't byteswap the built-in
data without copying it, which is undesirable. Pregenerate both big-
and little-endian compose data, and compile the correct flavour into
each build of GTK. This fixes failure of the composetable test when
building for a big-endian architecture such as s390x and (traditional,
big-endian) powerpc.

Bug: https://gitlab.gnome.org/GNOME/gtk/-/issues/4217
Signed-off-by: Simon McVittie <smcv@debian.org>
Forwarded: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3902
Applied-upstream: 4.5.0

Gbp-Pq: Name compose-Generate-endian-dependent-compact-Compose-data.patch
gtk/compose/compose-parse.c
gtk/gen-gtk-gresources-xml.py
gtk/meson.build